package praktikumid.w09.p1;

import java.awt.BorderLayout;

import javax.swing.JFrame;

/**
 * Frame.
 * @author Ago
 *
 */
public class MyFrame extends JFrame {

	/**
	 * Private reference to the draw panel.
	 */
	private DrawPanel drawPanel;

	/**
	 * Constructor. Initializes the frame.
	 */
	public MyFrame() {
		// when window is closed, let's exit from app
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(600, 600);
		
		// button panel
		ButtonPanel buttonPanel = new ButtonPanel(this);
		// "draw" panel
		drawPanel = new DrawPanel();
		
		// default layout manager for frame is border layout
		// let's add buttons on top
		getContentPane().add(buttonPanel, BorderLayout.NORTH);
		// and the rest is draw panel
		getContentPane().add(drawPanel, BorderLayout.CENTER);
	}
	
	/**
	 * Get method for DrawPanel.
	 * @return Reference to the DrawPanel
	 */
	public DrawPanel getDrawPanel() {
		return drawPanel;
	}
}
